package cn.itcast.bos.mq;

import javax.jms.JMSException;
import javax.jms.MapMessage;
import javax.jms.Message;
import javax.jms.MessageListener;

import org.springframework.stereotype.Service;




/** 
 * 发短信的消费类
 *
 * @author Shao-Fei Fan 
 * @version 1.0,2017年9月13日 下午9:07:35 
 */
@Service
public class smsConsumer implements MessageListener {

	@Override
	public void onMessage(Message message) {
		MapMessage mapMessage = (MapMessage) message;
		try {
			System.out.println(mapMessage.getString("telephone")+"验证码是:"+mapMessage.getString("msg"));
		} catch (JMSException e) {
			throw new RuntimeException("短信发送失败");
		}
	}

	

	

}
